package cn.itsource.user.controller;

import cn.itsource.basic.util.AjaxResult;
import cn.itsource.user.service.IVerifyCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/verifyCode")
public class VerifyCodeController {
    @Autowired
    private IVerifyCodeService verifyCodeService;
    @GetMapping("/imageCode/{key}")
    public AjaxResult imageCode(@PathVariable("key") String key) {
        return verifyCodeService.imageCode(key);
    }

    @PostMapping("/smsCode")
    public AjaxResult smsCode(@RequestBody Map<String, String> map){
        return verifyCodeService.smsCode(map);
    }

    @PostMapping("/binderSmsCode")
    public AjaxResult binderSmsCode(@RequestBody Map<String, String> map){
        return verifyCodeService.binderSmsCode(map);
    }


}
